﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiRenderEnvironmentTraitsData : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiRenderEnvironmentTraitsData(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiRenderEnvironmentTraitsData obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiRenderEnvironmentTraitsData()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiRenderEnvironmentTraitsData(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGiRenderEnvironmentTraitsData() : this(GlobalsPINVOKE.new_OdGiRenderEnvironmentTraitsData(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setEnable(bool bEnable)
		{
			GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_setEnable(this.swigCPtr, bEnable);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool enable()
		{
			bool result = GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_enable(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setIsBackground(bool bEnable)
		{
			GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_setIsBackground(this.swigCPtr, bEnable);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isBackground()
		{
			bool result = GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_isBackground(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setFogColor(OdCmEntityColor color)
		{
			GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_setFogColor(this.swigCPtr, OdCmEntityColor.getCPtr(color));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdCmEntityColor fogColor()
		{
			OdCmEntityColor result = new OdCmEntityColor(GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_fogColor(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setNearDistance(double nearDist)
		{
			GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_setNearDistance(this.swigCPtr, nearDist);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double nearDistance()
		{
			double result = GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_nearDistance(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setFarDistance(double farDist)
		{
			GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_setFarDistance(this.swigCPtr, farDist);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double farDistance()
		{
			double result = GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_farDistance(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setNearPercentage(double nearPct)
		{
			GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_setNearPercentage(this.swigCPtr, nearPct);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double nearPercentage()
		{
			double result = GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_nearPercentage(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setFarPercentage(double farPct)
		{
			GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_setFarPercentage(this.swigCPtr, farPct);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double farPercentage()
		{
			double result = GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_farPercentage(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setEnvironmentMap(OdGiMaterialTexture map)
		{
			GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_setEnvironmentMap(this.swigCPtr, OdGiMaterialTexture.getCPtr(map));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiMaterialTexture environmentMap()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_environmentMap(this.swigCPtr);
			OdGiMaterialTexture result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiMaterialTexture)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiMaterialTexture)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiMaterialTexture)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdGiRenderEnvironmentTraitsData data2)
		{
			bool result = GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_IsEqual(this.swigCPtr, OdGiRenderEnvironmentTraitsData.getCPtr(data2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsNotEqual(OdGiRenderEnvironmentTraitsData data2)
		{
			bool result = GlobalsPINVOKE.OdGiRenderEnvironmentTraitsData_IsNotEqual(this.swigCPtr, OdGiRenderEnvironmentTraitsData.getCPtr(data2));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
